#pragma once
#include "Entity.h"
#include "Struct.h"

enum class MarkerType { ALC, SQ_ALC, LDW, DCLC, ACC_TG, ACC_FD, TailLamp, RoadBg, ZhicheCircle };

class MarkerEntity : public Entity {
public:
	MarkerEntity(MarkerType type) { create(type); }

	MarkerEntity(MarkerType type, int boundModelID) { create(type, boundModelID); }

	void create(MarkerType type);
	void create(MarkerType type, int boundModelID);

private:
	MarkerEntity(Entity* parent): Entity(parent) {}

	void createALC();
	void createSQ_ALC();
	void createLDW();
	void createDCLC();
	void createACC_TG();
	void createACC_FD(int boundModelID);
	void createTailLamp();
	void createRoadBg();
	void createZhicheCircle();

	void createAccTGRects(int i, CVector<P>& vertices, CVector<UInt>& indices);
	void createTailLampLight(const CColor& color, HDir hdir, bool asChild);
	void createLineEllipse(const LineEq& eq, const CColor& color, HDir hdir);

	Entity* install(const CString& shaderName, PrimitiveType primitiveType, const CVector<P>& vertices, float vertex2dY, const CColor& color, bool asChild = false);
	Entity* install(const CString& shaderName, PrimitiveType primitiveType, const CVector<P>& vertices, float vertex2dY, const CVector<UInt>& indices, const CColor& color, bool asChild = false);
	Entity* install(const CString& shaderName, PrimitiveType primitiveType, const CVector<P3D>& vertices, const CColor& color, bool asChild = false);
	Entity* install(const CString& shaderName, PrimitiveType primitiveType, const CVector<P3D>& vertices, const CVector<UInt>& indices, const CColor& color, bool asChild = false);
	
	Entity* toInstall(const CString& shaderName, PrimitiveType primitiveType, const CVector<P>& vertices2d, float vertex2dY, const CVector<P3D>& vertices3d, const CVector<UInt>& indices, const CColor& color, bool asChild);
};